Queries in Access
Today you'll build six queries using the Access Query Design grid β filtering, sorting, and searching the DataDrop Songs database like a real data analyst.
| Operator | Meaning | Example |
|---|---|---|
| = | Exactly equal to | = "Pop" |
| > | Greater than | > 1000000 |
| < | Less than | < 2020 |
| >= | Greater than or equal to | >= 3 |
| <= | Less than or equal to | <= 4 |
| BETWEEN x AND y | In a range (inclusive) | BETWEEN 2019 AND 2021 |
| AND | Both conditions must be true | > 3 AND < 4 |
| OR | Either condition is true | "Pop" OR "Rock" |
| NOT | Excludes matching records | NOT "Pop" |
| LIKE "x*" | Starts with x (wildcard) | Like "The*" |
Query Tasks 1β3
Open DataDrop_L3.accdb and create a new query for each task. Name and save each one.
Query Tasks 4β6
These tasks use multiple criteria and wildcards. Think carefully about whether to put criteria on the same row (AND) or different rows (OR).
Extension: Parameterised Query
A parameterised query asks the user for input when it runs β instead of hard-coding the criteria.
[Enter a genre to search:]. When you run the query, Access will pop up a box asking the user to type a genre. The query then filters by whatever they type β dynamic search![Enter a genre to search:]. Save as "Genre Search".Exit Quiz
Download all your answers from every section as a text file β then upload to Google Classroom.
Excellent work β you can now query a database like a professional. Next lesson: you'll ditch the GUI and write real SQL β the language behind every major database on the planet.
Go to Lesson 4 β SQL β